# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=libavtp
pkgver=0.1.0
pkgrel=2
pkgdesc="Open source implementation of Audio Video Transport Protocol"
arch=('x86_64')
url="https://github.com/Avnu/libavtp"
license=('BSD')
depends=('glibc')
makedepends=('cmocka' 'meson')
provides=('libavtp.so')
source=("$pkgname-$pkgver.tar.gz::https://github.com/Avnu/${pkgname}/archive/v${pkgver}.tar.gz")
sha512sums=('b08d177bbf2e9059489b9d11869e8c8c46e3abce4d3c4a3cabc0aedaae41a591280a9f79295a5c17bcba3beb52e10061c062bceffed8e1a26589d5726f2c5428')

build() {
  cd "$pkgname-$pkgver"
  arch-meson --prefix=/usr \
             build
  ninja -C build
}

check() {
  cd "$pkgname-$pkgver"
  meson test -C build
}

package() {
  cd "$pkgname-$pkgver"
  DESTDIR="${pkgdir}" meson install -C build
  install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -vDm 644 {CONTRIBUTING,HACKING,README}.md \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}
